/*
 * @Copyright: 2016 www.yyfax.com Inc. All rights reserved.
 */
package com.yyfax.pay.order.data.dao;

import java.util.List;

import com.yyfax.framework.dao.BaseDao;
import com.yyfax.pay.order.model.po.UserPaymentPO;

/**
 * 用户支付信息持久化接口
 *
 * @author buyi
 * @date 2017-04-12 11:09:15
 * @since 1.0.0
 */
public interface UserPaymentDao extends BaseDao<UserPaymentPO, Integer> {

	/**
	 * 根据主键获取实体
	 * 
	 * @user jiangmy
	 * @date 2017-04-12 11:09:15
	 * @since 1.0.0
	 * @param id
	 *            自增主键
	 * @param merchantCode
	 *            商户编号(为分表预留参数)
	 * @return
	 */
	public UserPaymentPO selectByIdAndMerchantCode(int id, String merchantCode) throws Exception;

	/**
	 * 根据商户编号获取支付鉴权信息
	 * 
	 * @author buyi
	 * @date 2017-04-13 10:47:49
	 * @since v1.0.0
	 * @param merchantCode
	 * @return
	 */
	public List<UserPaymentPO> selectListByUserIdAndMerchantCode(String userId, String merchantCode);

	/**
	 * 查询指定用户的认证支付信息
	 * 
	 * @author buyi
	 * @date 2017-04-17 16:52:55
	 * @since v1.0.0
	 * @param merchantCode
	 * @param userId
	 * @param paymentCode
	 * @return
	 */
	public UserPaymentPO selectByMerchantCodeAndUserIdAndPaymentCode(String merchantCode, String userId,
			String paymentCode);

	/**
	 * 逻辑删除
	 * 
	 * @author buyi
	 * @date 2017-04-18 20:04:38
	 * @since v1.0.0
	 * @param merchantCode
	 * @param userId
	 * @param paymentCode
	 * @param cardNo
	 * @return
	 */
	public int delete(String merchantCode, String userId, String paymentCode, String cardNo);

	/**
	 * 更新手机号码
	 * @author buyi
	 * @date 2017-04-18 20:04:38
	 * @since v1.1.0
	 * @param userAuthId
	 * @param phone
	 * @return
	 */
	public int updatePhone(int id, String phone);

	/**
	 * 更新手机号码
	 * 
	 * @author buyi
	 * @date 2017-09-15 10:05:18
	 * @since v2.0.0
	 *
	 * @param merchantCode
	 * @param userId
	 * @param paymentCode
	 * @param phone
	 * @return
	 */
	public int updatePhoneByMerchantAndUserIdAndPayment(String merchantCode, String userId, String paymentCode, String phone);

}
